How to clear screen in python?
Most of the time, while working with Python interactive shell/terminal (not a console), we end up with a messy output and want to clear the screen for some reason. In an interactive shell/terminal, we can simply use...
read more
Check if Binary representation is Palindrome in Python
Given an integer ‘n’, write a Python function that returns true if binary representation of x is palindrome else return false. Examples:...
read more
Python Program to Find a pair with the given difference
Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples:...
read more
Python – Frequency of x follow y in Number
Sometimes, while working with Numbers in Python, we can have a problem in which we need to get the number of time one number follows other. This can have application in many domains such as day-day programming and other domains. Let us discuss certain ways in which this task can be performed....
read more
Python | Consecutive Character Maximum difference
Sometimes, we might have a problem in which we require to get the maximum difference of 2 numbers from list but with a constraint of having the numbers in successions. This type of problem can occur while competitive programming. Let’s discuss certain ways in which this problem can be solved....
read more
Python | Index Maximum among Tuples
Sometimes, while working with records, we might have a common problem of maximizing contents of one tuple with corresponding index of other tuple. This has application in almost all the domains in which we work with tuple records. Let’s discuss certain ways in which this task can be performed....
read more
Python – Records Maxima in List of Tuples
Sometimes, while working with records, we can have a problem in which we need to the maximum all the columns of a container of lists that are tuples. This kind of application is common in the web development domain. Let’s discuss certain ways in which this task can be performed....
read more
Python | Least Value test in Dictionary
While working with dictionary, we might come to a problem in which we require to ensure that all the values are atleast K in dictionary. This kind of problem can occur while checking status of start or checking for a bug/action that could have occurred. Let’s discuss certain ways in which this task can be performed....
read more
Python | Arrange Tuples consecutively in list
Sometimes, while working with tuple list, we may require a case in which we require that a tuple starts from the end of previous tuple, i.e the element 0 of every tuple should be equal to ending element of tuple in list of tuple. This type of problem and sorting is useful in competitive programming. Let’s discuss way in which this problem can be solved....
read more
Python Program to Reverse the Content of a File using Stack
Given a file, the task is to change the content in reverse order using Stack, as well as store the lines of that file in reverse order in Python....
read more
Iterative Boundary Traversal of Complete Binary tree
Given a complete binary tree, traverse it such that all the boundary nodes are visited in Anti-Clockwise order starting from the root....
read more
Python program to Represent Negative Integers in binary format
Given a Negative Integer, the task is to write a Python program to convert the integer into binary format....
read more